package com.txf.coomon.mvp.net_retrofit.presenter;

import android.content.Context;

import com.google.gson.JsonElement;
import com.txf.coomon.net.net_retrofit.response.AppBaseResponse;
import com.txf.coomon.net.net_retrofit.listener.AppRequestListener;
import com.txf.coomon.mvp.net_retrofit.contract.DemoContract;
import com.txf.coomon.mvp.net_retrofit.model.DemoModel;

import java.util.HashMap;


/**
 * @author txf
 * @create 2019/1/22 0022
 * @
 */

public class DemoPresenter extends DemoContract.Presenter {

    private Context mContext;
    private DemoModel model;

    public DemoPresenter(Context mContext) {
        model = new DemoModel();
        this.mContext = mContext;
    }

    @Override
    public void getData(int with, HashMap<String, Object> maps, boolean isLoading, boolean cancelable) {

        model.getData(mContext, maps, isLoading, cancelable, getView().bindLifecycle(), new AppRequestListener<AppBaseResponse<JsonElement>>() {
            @Override
            public void onNext(AppBaseResponse<JsonElement> response) {

            }

            @Override
            public void onError(Object e) {

            }
        });
    }
}
